package com.zxk.blog.feign;

import com.zxk.core.common.util.JsonData;
import com.zxk.core.common.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

@FeignClient(value = "blog-crawler",fallback = CrawlerEsFeignServiceImpl.class)
public interface CrawlerEsFeignService {

    @PostMapping("/get/{index}/{field}/{keyword}/{pageNo}/{pageSize}")
    JsonData getEsDada(@PathVariable(value = "index") String index,
                              @PathVariable(value = "field") String field,
                              @PathVariable(value = "keyword") String keyword,
                              @PathVariable(value = "pageNo") Integer pageNo,
                              @PathVariable(value = "pageSize") Integer pageSize);


    @PostMapping("/blog/crawler/search/news")
     R  searchNewsByCondition(@RequestBody Map<String,Object> condition);
}
